package com.health.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("log")
@ApiModel(value = "BlogOperationLog对象")
public class HealthLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("操作模块")
    private String optModule;

    @ApiModelProperty("操作类型")
    private String optType;

    @ApiModelProperty("操作url")
    private String optUrl;

    @ApiModelProperty("操作方法")
    private String optMethod;

    @ApiModelProperty("操作描述")
    private String optDesc;

    @ApiModelProperty("请求参数")
    private String requestParam;

    @ApiModelProperty("请求方式")
    private String requestMethod;

    @ApiModelProperty("返回数据")
    private String responseData;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("用户昵称")
    private String nickname;

    @ApiModelProperty("操作ip")
    private String ipAddress;

    @ApiModelProperty("操作地址")
    private String ipSource;

    @ApiModelProperty("日志类型 0 -> 操作日志 1-> 异常日志")
    private Integer type;

    @ApiModelProperty("异常详细")
    private byte[] exceptionDetail;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

}
